package com.ygbhu.design.prototype;

import java.util.Date;

/**
 * @program: design-pattern
 * @description: 视频
 * @author: smzhu3
 * @create: 2021-07-08 17:19
 **/
public class Video implements Cloneable {
    private String name;
    private Date createDate;

    public Video(String name, Date createDate) {
        this.name = name;
        this.createDate = createDate;
    }

    /***
     * @Description: 深克隆
     * @param
     * @return: java.lang.Object
     * @Author: smzhu3
     * @Date: 2021/7/8 17:22
     */
    @Override
    public Object clone() throws CloneNotSupportedException{
        Object obj = super.clone();
        Video v = (Video)obj;
        v.createDate=(Date)this.createDate.clone();
        return obj;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Override
    public String toString() {
        return "Video{" +
                "name='" + name + '\'' +
                ", createDate=" + createDate +
                '}';
    }
}
